﻿<Window x:Class="Microsoft.Samples.Kinect.AudioBasics.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Audio Basics" Height="580" Width="800"
        Loaded="WindowLoaded" Closing="WindowClosing">
    <Window.Resources>
        <SolidColorBrush x:Key="MediumGreyBrush" Color="#ff6e6e6e"/>
        <Color x:Key="KinectPurpleColor">#ff52318f</Color>
        <Style TargetType="{x:Type Image}">
            <Setter Property="SnapsToDevicePixels" Value="True"/>
        </Style>
    </Window.Resources>
    
    <Grid Name="layoutGrid" Margin="10 0 10 0">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <DockPanel Grid.Row="0" Margin="0 0 0 20">
            <Image DockPanel.Dock="Left" Source="Images\Logo.png" Stretch="None" HorizontalAlignment="Left" Margin="0 10 0 5"/>
            <TextBlock DockPanel.Dock="Right" Margin="0 0 -1 0" Grid.Column="2" HorizontalAlignment="Right" VerticalAlignment="Bottom" Foreground="{StaticResource MediumGreyBrush}" FontFamily="Segoe UI" FontSize="18" Padding="0 0 0 0">Audio Basics</TextBlock>
            <Image Grid.Column="1" Source="Images\Status.png" Stretch="None" HorizontalAlignment="Center" Margin="0 0 0 5"/>
        </DockPanel>
        <Viewbox Grid.Row="1" Stretch="Uniform">
            <Canvas Width="1" Height="0.52">
                <Image Width="0.74" Height="0.185" x:Name="waveDisplay" VerticalAlignment="Top" HorizontalAlignment="Left">
                    <Image.RenderTransform>
                        <TranslateTransform X="0.13" Y="0.0353"/>
                    </Image.RenderTransform>
                </Image>
                <Path Data="M 0.1503,0.2832 L 0.228,0.2203 A 0.35,0.35 102 0 0 0.772,0.2203 L 0.8497,0.2832 A 0.45,0.45 102 0 1 0.1503,0.2832 Z">
                    <Path.Fill>
                        <RadialGradientBrush Center="0.5 -0.32" RadiusX="0.65" RadiusY="1.1">
                            <RadialGradientBrush.GradientStops>
                                <GradientStop Color="LightGray" Offset="0"/>
                                <GradientStop Color="LightGray" Offset="0.4"/>
                                <GradientStop Color="WhiteSmoke" Offset="0.6"/>
                                <GradientStop Color="WhiteSmoke" Offset="1"/>
                            </RadialGradientBrush.GradientStops>
                        </RadialGradientBrush>
                    </Path.Fill>
                </Path>
                <Path Data="M 0.1270,0.3021 L 0.1503,0.2832 A 0.45,0.45 102 0 0 0.8497,0.2832 L 0.8730,0.3021 A 0.48,0.48 102 0 1 0.1270,0.3021 Z">
                    <Path.Fill>
                        <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
                            <LinearGradientBrush.GradientStops>
                                <GradientStop x:Name="sourceGsStart"  Color="White"   Offset="0" />
                                <GradientStop x:Name="sourceGsPre"    Color="White"   Offset="0.45" />
                                <GradientStop x:Name="sourceGsMain"   Color="{StaticResource KinectPurpleColor}"  Offset="0.5" />
                                <GradientStop x:Name="sourceGsPost"   Color="White"   Offset="0.55" />
                                <GradientStop x:Name="sourceGsEnd"    Color="White"   Offset="1" />
                            </LinearGradientBrush.GradientStops>
                            <LinearGradientBrush.Transform>
                                <RotateTransform x:Name="sourceRotation" CenterX="0.5" CenterY="0.0" Angle="0"></RotateTransform>
                            </LinearGradientBrush.Transform>
                        </LinearGradientBrush>
                    </Path.Fill>
                </Path>
                <Path Data="M 0.495,0.35 L 0.505,0.35 L 0.5,0.44 Z">
                    <Path.RenderTransform>
                        <RotateTransform x:Name="beamRotation"  CenterX="0.5" CenterY="0.0" Angle="0"/>
                    </Path.RenderTransform>
                    <Path.Fill>
                        <LinearGradientBrush>
                            <GradientStop Color="LightGray" Offset="0"/>
                            <GradientStop Color="{StaticResource KinectPurpleColor}" Offset="0.5"/>
                            <GradientStop Color="{StaticResource KinectPurpleColor}" Offset="1"/>
                        </LinearGradientBrush>
                    </Path.Fill>
                </Path>
                <Path Data="M 0.1270,0.3021 L 0.228,0.2203 A 0.35,0.35 102 0 0 0.772,0.2203 L 0.8730,0.3021 A 0.48,0.48 102 0 1 0.1270,0.3021 Z"  StrokeThickness="0.001" Stroke="LightGray"/>
                <Path Data="M 0.2280,0.2203 L 0.13,0.2203 L 0.13,0.0353 L 0.15,0.0353" StrokeThickness="0.001" Stroke="LightGray"/>
                <Path Data="M 0.7720,0.2203 L 0.87,0.2203 L 0.87,0.0353 L 0.85,0.0353" StrokeThickness="0.001" Stroke="LightGray"/>
            </Canvas>
        </Viewbox>
        <Grid Grid.Row="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="3*"/>
                <ColumnDefinition Width="3*"/>
                <ColumnDefinition Width="3*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <TextBox Grid.Column="1" Name="beamAngleText" FontSize="14" FontFamily="Segoe" HorizontalAlignment="Center" IsReadOnly="True" BorderThickness="0">Audio Beam Angle = 0 deg.</TextBox>
            <TextBox Grid.Column="2" Name="sourceAngleText" FontSize="14" FontFamily="Segoe" HorizontalAlignment="Center" IsReadOnly="True" BorderThickness="0">Audio Source Angle = 0 deg.</TextBox>
            <TextBox Grid.Column="3" Name="sourceConfidenceText" FontSize="14" FontFamily="Segoe" HorizontalAlignment="Center" IsReadOnly="True" BorderThickness="0">Confidence Level = 0.00</TextBox>
        </Grid>
        <StatusBar Grid.Row="3" Height="23" HorizontalAlignment="Stretch" Name="statusBar" VerticalAlignment="Bottom" Margin="0 10 0 10" Background="White" Foreground="{StaticResource MediumGreyBrush}">
            <StatusBarItem Padding="0">
                <TextBlock Name="statusBarText"></TextBlock>
            </StatusBarItem>
        </StatusBar>
    </Grid>
</Window>
